/*
 * Copyright (C) 2011 Kulabuhov Michael, Kemerovo, Russia.
 *
 * See the LICENSE file for terms of use.
 */

#include <Wt/WText>
#include <Wt/WVBoxLayout>
#include <Wt/WHBoxLayout>
#include <Wt/WMenu>
#include <Wt/WStackedWidget>
#include "wpersephonebody.h"

WPersephoneBody::WPersephoneBody(WContainerWidget *parent)
  : WContainerWidget(parent)
{
  WVBoxLayout *box = new WVBoxLayout(this);
  box->setContentsMargins(0, 0, 0, 0);
  box->setSpacing(0);

  WStackedWidget *stack =  new WStackedWidget();

  WContainerWidget *menuContainer = new WContainerWidget();
  menuContainer->setStyleClass("menu_line");
  WHBoxLayout *menuBox = new WHBoxLayout(menuContainer);
  menuBox->setContentsMargins(8, 0, 8, 0);
  menuBox->setSpacing(0);

  WMenu *menu = new WMenu(stack, Horizontal);
  menu->setInternalPathEnabled();
  menu->setInternalBasePath("/");
  menuBox->addWidget(menu, 1, AlignRight);

  box->addWidget(menuContainer, 0);
  box->addWidget(stack, 1);

  WText *main = new WText(utf8("Главная"));
  WText *news = new WText(utf8("Новости"));

  menu->addItem(tr("page-main"), main);
  menu->addItem(tr("page-news"), news);
}
